package com.gui.liner.link;

public class HeroLinkedList {

    private Node head;

    private int size;

    public HeroLinkedList() {
        // 头节点都是null
        this.head = new Node(null, null, null);
        this.size = 0;
    }


    /**
     * 按顺序添加
     * @param order 顺序
     * @param name 名称
     */
    public void add(Integer order, String name) {
        Node temp = head;

        if (temp.next == null) {
            temp.next = new Node(order, name, null);
        }

        while (temp.next != null) {
            Integer nextOrder = temp.next.order;

        }
    }


    private static class Node {

        private Integer order;

        private String name;

        private Node next;

        public Node(Integer order, String name, Node next) {
            this.order = order;
            this.name = name;
            this.next = next;
        }

        @Override
        public String toString() {
            return "{" +
                    "order=" + order +
                    ", name=" + name +
                    '}';
        }
    }
}
